import turtle
import random
# 彩色三角形
turtle.colormode(255)
n = 0
while n < 4:
    r = random.randint(0, 255)
    g = random.randint(0, 255)
    b = random.randint(0, 255)
    turtle.fillcolor(r, g, b)
    turtle.begin_fill()
    turtle.goto(160-n*40, 0)
    turtle.goto(0, 160-n*40)
    turtle.goto(0,0)
    turtle.end_fill()
    n += 1
turtle.done()
